package com.jieshuibao.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jieshuibao.mapper.RotationMapper;
import com.jieshuibao.model.db.Rotation;
import com.jieshuibao.model.db.RotationExample;

@Service
public class RotationService{
	
	@Resource
	private RotationMapper rotationMapper;
	
	public void addRotation(Rotation rotation) {
		rotationMapper.insertSelective(rotation);
	}
	
	public void delRotationByUuid(String uuid) {
		rotationMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateRotation(Rotation rotation) {
		rotationMapper.updateByPrimaryKeySelective(rotation);
	}
	
	public Rotation getRotationByUuid(String uuid) {
		return rotationMapper.selectByPrimaryKey(uuid);
	}
	
	public List<Rotation> getPageRotation(RotationExample rotationExample) {
		return rotationMapper.selectPage(rotationExample);
	}
	public List<Rotation> getRotations(RotationExample rotationExample) {
		return rotationMapper.selectByExample(rotationExample);
	}
	public int countRotation(RotationExample rotationExample) {
		return rotationMapper.countByExample(rotationExample);
	}
}
